package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.AlertDataPageQueryDto;
import com.zzyl.entity.AlertData;
import com.zzyl.vo.AlertDataVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface AlertDataMapper {
    int deleteByPrimaryKey(Long id);

    int insert(AlertData record);

    int insertSelective(AlertData record);

    AlertData selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(AlertData record);

    int updateByPrimaryKey(AlertData record);

    /**
     * 这是Mybatis Generator拓展插件生成的方法(请勿删除).
     * This method corresponds to the database table alert_data
     *
     * @mbg.generated
     * @author hewei
     */
    int batchInsert(@Param("list") List<AlertData> list);

    //Long id, Integer status, String deviceName, Long id1, LocalDateTime startTime, LocalDateTime endTime
    Page<AlertDataVo> adminPageQuery(
            @Param("id") Long id,
            @Param("status") Integer status,
            @Param("deviceName") String deviceName,
            @Param("minCreateTime") LocalDateTime minCreateTime,
            @Param("maxCreateTime") LocalDateTime maxCreateTime);

//    Long id, String processingResult, LocalDateTime processingTime, String realName, Long id1, String iotId
    void handleAlertData(@Param("id") Long id,
                         @Param("processingResult") String processingResult,
                         @Param("processingTime") LocalDateTime processingTime,
                         @Param("realName") String realName,
                         @Param("updateBy") Long updateBy,
                         @Param("iotId") String iotId);

    void updateAlertDataStatus(@Param("processingResult") String processingResult,
                               @Param("processingTime") LocalDateTime processingTime,
                               @Param("realName") String realName,
                               @Param("updateBy") Long updateBy,
                               @Param("iotId") String iotId);
}